package com.it.server.mapper;

import com.it.pojo.Entity.Dish;
import com.it.pojo.VO.DishDetailVO;
import com.it.pojo.VO.DishRotationVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishMapper {
    /**
     * 轮播图
     * @param merchantId
     * @return
     */
    List<DishRotationVO> rotation(Integer merchantId);
   /**
     * 菜品列表
     * @param merchantId
     * @return
     */
    @Select("select * from dish where merchant_id=#{merchantId} order by created_at desc")
    List<Dish> list(Integer merchantId);
    /**
     * 菜品详情
     * @param id
     * @return
     */
    @Select("select * from dish where id=#{id}")
    Dish detail(Integer id);

    void add(Dish dish);
}
